package com.pkx.cloud.fse7.dms.area.service.impl;

import com.pkx.cloud.fse7.dms.area.entity.DmsArea;
import com.pkx.cloud.fse7.dms.area.repo.DmsAreaMapper;
import com.pkx.cloud.fse7.dms.area.service.DmsAreaService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

/**
 *  服务实现类
 *
 * @author chenwg
 * @since 2020-11-13
 */
@Service
public class DmsAreaServiceImpl extends ServiceImpl<DmsAreaMapper, DmsArea> implements DmsAreaService {

    /**
     * 分页列表
     *
     * @param dmsArea
     * @return
     */
    @Override
    public Page<DmsArea> pageList(Page page, DmsArea dmsArea) {
        LambdaQueryWrapper<DmsArea> lambdaQueryWrapper = Wrappers.lambdaQuery(DmsArea.class);
        return page(page, lambdaQueryWrapper);
    }

    /**
     * 列表查询
     *
     * @param dmsArea
     * @return
     */
    @Override
    public List<DmsArea> listByEntity(DmsArea dmsArea) {
        LambdaQueryWrapper<DmsArea> lambdaQueryWrapper = Wrappers.lambdaQuery(DmsArea.class);
        return list(lambdaQueryWrapper);
    }

    /**
     * 详情
     *
     * @param id
     * @return
     */
    @Override
    public DmsArea selectById(Long id) {
        return getById(id);
    }

    /**
     * 保存
     *
     * @param dmsArea
     * @return
     */
    @Override
    public Boolean saveDmsArea(DmsArea dmsArea) {
        return save(dmsArea);
    }

    /**
     * 修改
     *
     * @param dmsArea
     * @return
     */
    @Override
    public Boolean modify(DmsArea dmsArea) {
        return updateById(dmsArea);
    }

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @Override
    public Boolean deleteById(Long id) {
        return removeById(id);
    }
}
